#define DEBUG
#include <cstdio>
#include <cstring>
#define MAXN 200

using namespace std;

int min(int a, int b) {
  return a<b ? a : b;
}

int max(int a, int b) {
  return a>b ? a : b;
}

class Graph {
public:
  int n, m, ind[MAXN], to[MAXN*MAXN+1], link[MAXN*MAXN+1], a[MAXN+1], b[MAXN+1];
  bool used[MAXN+1];

  void addSide(int u, int v) {
    m++;
    to[m] = v;
    link[m] = ind[u];
    ind[u] = m;
  }

  bool find(int o) {
    for (int i=ind[o]; i; i=link[i]) {
      if (!used[to[i]]) {
	used[to[i]] = true;
	if ((!b[to[i]]) || find(b[to[i]])) {
	  a[o] = to[i];
	  b[to[i]] = o;
	  return true;
	}
      }
    }
    return false;
  }
};

int main() {
#ifdef DEBUG
  freopen("2.in", "r", stdin);
  freopen("2.out", "w", stdout);
#endif

  static int range[MAXN+1][2], prange[MAXN+1][2];
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i=1; i<=n; i++) {
    range[i][0] = prange[i][0] = 1, range[i][1] = prange[i][1] = n;
  }
  for (int i=1; i<=m; i++) {
    int kind, x, y, v;
    scanf("%d %d %d %d", &kind, &x, &y, &v);
    prange[v][0] = max(prange[v][0], x);
    prange[v][1] = min(prange[v][1], y);
    for (int j=x; j<=y; j++) {
      if (kind==1) {
	range[j][1] = min(range[j][1], v);
      } else {
	range[j][0] = max(range[j][0], v);
      }
    }
  }

  static Graph g;
  for (int i=1; i<=n; i++) {
    for (int j=range[i][0]; j<=range[i][1]; j++) {
      if (prange[j][0]<=i && prange[j][1]>=i) {
	g.addSide(i, j);
      }
    }
  }

  int tot=0;
  for (int i=1; i<=n; i++) {
    memset(g.used, 0, sizeof(g.used));
    tot+=g.find(i);
  }

  if (tot<n) {
    printf("-1");
  } else {
    for (int i=1; i<=n; i++) {
      printf("%d ", g.a[i]);
    }
  }

  fcloseall();
  return 0;
}
